package br.com.JZSolution.domineduplex.utils;

import java.io.IOException;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.Document;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

public class XmlUtils {
	
	 	private static DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
	    
	    public static Document StringToXml(String xmlString) throws ParserConfigurationException,IOException,SAXException{
	    	DocumentBuilder db = factory.newDocumentBuilder();
		    InputSource inStream = new InputSource();
	    	inStream.setCharacterStream(new java.io.StringReader(xmlString));
		    Document doc = db.parse(inStream);
		    return doc;
	    }
}
